package com.heima.controller;

import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.media.dto.WmNewsPageReqDto;
import com.heima.service.WmNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/news")
public class WmNewsController {

    @Autowired
    private WmNewsService wmNewsService;


    // 查询所有文章
    @PostMapping("/list")
    public PageResponseResult newsList(@RequestBody WmNewsPageReqDto dto) {
        return wmNewsService.newsList(dto);
    }
}
